package com.joysuch.wwyt.streampusher;

import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;

/**
 * @author jiahao
 * @date 2020/7/30 19
 */
public abstract class JsAbstractRedisSubscriber implements JsRedisSubscriber {

    @Autowired
    private DefaultRedisBroker defaultRedisBroker;

    private String topic;

    public JsAbstractRedisSubscriber(String topic) {
        this.topic = topic;
    }

    @PostConstruct
    public void bindTopic() {
        defaultRedisBroker.bindTopic(this.topic, this);
    }
}
